fn main() {
    let mut num = Some(5);
    let mut str = Some(String::from("hello"));

    let mut x = 5;
    let mut y: Option<i32> = Some(5);

    let mut temp = 0;
    match y {
        Some(i) => {
            temp = i;
        }
        None => {
            println!("aaa");
        }
    }

    let mut sum = x + temp;
    println!("sum={}", sum);


    let mut result = plus_one(y);
    match result {
        Some(i) => println!("result={}", i),
        None => {
            println!("nothing");
        }
    }
}

fn plus_one(x: Option<i32>) -> Option<i32> {
    match x {
        None => None,
        Some(x) => Some(x + 1),
    }
}
